home *** CD-ROM | disk | FTP | other *** search
/ Stone Design / Stone Design.iso / Stone_Friends / Wave / WavesWorld / Source / IBPalettes / WW3DKit / WW3DSnapShot.m < prev    next >
Encoding:
Text File  |  1995-03-22  |  1.8 KB  |  68 lines

  1. // copyright 1993 Michael B. Johnson; some portions copyright 1994, MIT
  2. // see COPYRIGHT for reuse legalities
  3. //
  4.  
  5.  
  6. #import "WW3DSnapShot.h"
  7.  
  8. @implementation WW3DSnapShot
  9.  
  10. - initFromCamera:aCamera
  11. {
  12.    [super init];
  13.    backgroundColor = [aCamera backgroundColor];
  14.    doesDrawBackgroundColor = [aCamera doesDrawBackgroundColor];
  15.  
  16.    hider = [aCamera hider];
  17.    [aCamera getProjectionRectangle:&l :&r :&t :&b];
  18.    projectionType = [aCamera projectionType];
  19.  
  20.    [aCamera getPreTransformMatrix:preTransform];
  21.    [aCamera getTransformMatrix:transform];  // need to implement this in WW3DCamera
  22.    usesPreTransformMatrix = [aCamera usesPreTransformMatrix];
  23.  
  24.    [aCamera getEyeAt:&eyePoint toward:&viewPoint roll:&rollAngle];
  25.    [aCamera getClipPlanesNear:&nearPlane far:&farPlane];
  26.  
  27.    fieldOfView = [aCamera fieldOfView];
  28.    pixelAspectRatio = [aCamera pixelAspectRatio];
  29.  
  30.    return self;
  31. }
  32.  
  33. - snapCamera:aCamera
  34. {
  35.   return self;
  36. }
  37.  
  38. - (char *)writeAsTcl
  39. {
  40.   // really should have this archive itself to a stream
  41.   // anyway...
  42.   // should also have an initFromTcl:(const char *)tclExpression tclInterp:aTclInterp
  43.   // anyway...
  44.   // the basic idea here is that the WW3DSnapShot needs to turn itself
  45.   // into the equivalent tcl code that it could be init'ed from
  46.  
  47.   return NULL;
  48. }
  49.  
  50. - applyToCamera:aCamera
  51. {
  52.  
  53.   [aCamera setBackgroundColor:backgroundColor];
  54.   [aCamera setHider:hider];
  55.   [aCamera setProjectionRectangle:l :r :t :b];
  56.   [aCamera setProjection:projectionType];
  57.   [aCamera setPreTransformMatrix:preTransform];
  58.   [aCamera setUsePreTransformMatrix:usesPreTransformMatrix];
  59.   [aCamera setEyeAt:eyePoint toward:viewPoint roll:rollAngle];
  60.   [aCamera setClipPlanesNear:nearPlane far:farPlane];
  61.   [aCamera setFieldOfViewByAngle:fieldOfView];
  62.   [aCamera setPixelAspectRatio:pixelAspectRatio];
  63.  
  64.   return self;
  65. }
  66.  
  67. @end
  68.